<template>
  <div v-loading="pageLoading" style="padding-left:24px">
    <div class="tab">
      <el-table :data="tableData" :border="false">
        <el-table-column label="赛事名称" min-width="180">
          <template slot-scope="{row}">
            <el-popover placement="bottom" width="180" trigger="hover" :content="row.competitionName">
              <span slot="reference">
                {{ row.competitionName.length > 18 ? row.competitionName.substr(0,18) + '...': row.competitionName }}
              </span>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column label="参赛人数" align="center">
          <template slot-scope="{row}">
            {{ row.athleteCount }}
          </template>
        </el-table-column>
        <el-table-column label="参赛人次" align="center">
          <template slot-scope="{row}">
            {{ row.entryCount }}
          </template>
        </el-table-column>
        <el-table-column label="金牌" align="center">
          <template slot-scope="{row}">
            {{ row.goldCount }}
          </template>
        </el-table-column>
        <el-table-column label="银牌" align="center">
          <template slot-scope="{row}">
            {{ row.silverCount }}
          </template>
        </el-table-column>
        <el-table-column label="铜牌" align="center">
          <template slot-scope="{row}">
            {{ row.bronzeCount }}
          </template>
        </el-table-column>
      </el-table>
    </div>
    <el-row class="gl_pt_20" style="text-align: right;">
      <el-pagination
        :current-page="Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.page"
        :page-size="Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.MaxResultCount"
        :total="total"
        layout="total,sizes,prev,pager,next,jumper"
        :page-sizes="[10, 20, 30, 40]"
        @size-change="sizeChange"
        @current-change="pageIndexChange"
      />
    </el-row>
  </div>
</template>
<script>
import { Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO } from '@/lib/form/game/swaggerForm';
import { api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatistics } from '@/extend/api/gameswaggerApi/app';
export default {
  data() {
    return {
      pageLoading: false,
      total: 0,
      Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO: new Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO(),
      chaxun: '',
      tableData: []
    };
  },
  created() {
    this.getGamList();
  },
  methods: {
    getGamList(page) {
      this.pageLoading = true;
      this.Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.Page = page || 1;
      this.Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.DelegationId = this.$route.query.gid;
      this.Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.SkipCount = (this.Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.Page - 1) * this.Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.MaxResultCount;
      api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatistics(this.Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO).then((res) => {
        this.tableData = res.items;
        this.pageLoading = false;
        this.total = res.totalCount;
      });
    },
    sizeChange(MaxResultCount) {
      this.Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.MaxResultCount = MaxResultCount;
      this.getGamList();
    },
    pageIndexChange(currentPage) {
      this.Api_GET_EventsManagementCompetitionEntryDataDelegationCompetitionStatisticsQO.Page = currentPage;
      this.getGamList(currentPage);
    }
  }
};
</script>
<style lang="scss" scoped>
.tab{
    border-radius: 15px;
    overflow: hidden;
    box-shadow:0px 0px 15px #e0dada;
    padding-top: 20px;
    padding-left: 10px;
    padding-right: 12px;
}
.ditu{
    display: inline-block;
    width: 31px;
    height: 36px;
    text-align: center;
    line-height: 36px;
}
.ditu1{
    background-image:url(../../assets/images/league/rank_1.png);
    background-size: 103%;
    color: white;
}
.ditu2{
    background-image:url(../../assets/images/league/rank_2.png);
    background-size: 103%;
    color: white;
}
.ditu3{
    background-image:url(../../assets/images/league/rank_3.png);
    background-size: 103%;
    color: white;
}
.roodsPhoto{
    width: 48px;
    height: 48px;
    border-radius: 50%;
  }
//去掉表格竖线
/deep/.el-table_header td,/deep/.el-table td,/deep/.el-table th{
    border-right: 0px;
}
/deep/.el-table{
    border: 0px;
    border-radius: 10px;
    border-right: 0px !important;
}
</style>
